package map;

import java.util.*;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.Predicate;

public class HashMapTest {
    public static void main(String[] args) {
        List<String> list = Arrays.asList("1");
        System.err.println(list.get(0));
        String a = "wwww {#EQWQ} eee {#EQWQ}";
        String b = a.replaceAll("\\{#EQWQ}","1234");
        System.err.println(b);
        Thread v = new Thread(()->{
            Thread d = new Thread(()->{
                while (!Thread.currentThread().isInterrupted()) {

                    System.err.println("守护现场");
                }
            });
            d.setDaemon(true);
            d.start();

            System.err.println("守护现场启动");
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
            d.interrupt();
            return;
        });
        v.start();
        try {
            Thread.sleep(3000);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
        v.stop();

        while (true) {
            System.err.println("等待");
        }


    }

}
